exports.add=[{
	_type:"functions",
	_section:"Date",

	to_str_isodate: function(d) {
		var r="";
		r+=d.getFullYear();
		r+="-";
		if (d.getMonth()<9) r+="0";
		r+=(d.getMonth()+1);
		r+="-";
		if (d.getDate()<10) r+="0";
		r+=d.getDate();
		return r;
	},

	to_str_date: function(d) {
		var r="";
		if (d.getDate()<10) r+="0";
		r+=d.getDate();
		r+=".";
		if (d.getMonth()<9) r+="0";
		r+=(d.getMonth()+1);
		r+=".";
		r+=d.getFullYear();
		return r;
	},

	to_str_timestamp: function(d) {
		var r="";
		if (d.getDate()<10) r+="0";
		r+=d.getDate();
		r+=".";
		if (d.getMonth()<9) r+="0";
		r+=(d.getMonth()+1);
		r+=".";
		r+=d.getFullYear();
		r+=" ";
		if (d.getHours()<10) r+="0";
		r+=d.getHours();
		r+=":";
		if (d.getMinutes()<10) r+="0";
		r+=d.getMinutes();
		r+=":";
		if (d.getSeconds()<10) r+="0";
		r+=d.getSeconds();
		return r;
	},

	to_date: function(str) {
		var d=new Date(0);
		var arr=str.match(/^(\d+)\.(\d+)\.(\d+)(?: (\d+):(\d+):(\d+)|)$/);
		d.setDate(1*arr[1]);
		d.setMonth(1*arr[2]-1);
		d.setFullYear(1*arr[3]);
		if (arr[4]) {
			d.setHours(arr[4]);
			d.setMinutes(arr[5]);
			d.setSeconds(arr[6]);
		}
		return d;
	}

}];
